package com.neusmart.common.dialog;

import android.content.Context;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.TextView;

import com.neusmart.common.R;
import com.neusmart.common.effects.EffectsType;

public class HintDialog extends BaseDialog implements OnClickListener {

    private TextView message;
    private OnHintListener l;

    public HintDialog(Context context) {
        super(context);
        init();
    }

    @Override
    protected int getLayoutResID() {
        return R.layout.hint_dialog;
    }

    @Override
    protected void initView() {
        mainView = findViewById(R.id.main);
        message = (TextView) findViewById(R.id.hint_message);
    }

    @Override
    protected void setListener() {
        super.setListener();
        findViewById(R.id.hint_btn_confirm).setOnClickListener(this);
    }

    public void setOnHintListener(OnHintListener l) {
        this.l = l;
    }

    @Override
    public void onClick(View v) {
        int i = v.getId();
        if (i == R.id.hint_btn_confirm) {
            if (l != null)
                l.onHint();
            dismiss();
        }
    }

    public void setMessage(String text) {
        message.setText(text);
    }

    public void setMessage(int resid) {
        message.setText(resid);
    }

    @Override
    protected EffectsType initEffectsType() {
        return EffectsType.RotateBottom;
    }

}
